 // 封装本地存储模块

 /**
  * 存储数据
  */
 export const setStor = (key, value) => {
     if (!key) return
     if (typeof value === 'object') {
         value = JSON.stringify(value)
     }
     window.localStorage.setItem(key, value) // 进行保存
 }

 // 读取数据
 export const getStor = key => {
     const data = window.localStorage.getItem(key)
     try {
         return JSON.parse(data)
     } catch (err) {
         return data
     }
 }

 /**
  * 
  * 删除数据 
  */
 export const removeStor = key => {
     window.localStorage.removeItem(key)
 }
